/*********************************************************************************
 *       Filename:  socket.h
 *    Description:  This file statement of the socket.c
 *
 *        Version:  1.0.0(2024/11/29 11:17:34)
 *         Author:  Zhang Long <1318085470@qq.com>
 *      ChangeLog:  1, Release initial version on "2024/11/29 11:17:34"
 ********************************************************************************/
#ifndef _SOCKET_H_
#define _SOCKET_H_
typedef struct socket_s
{
	int 	fd;
	char	host[64];
	int		port;
	int     connected; 
}socket_t;
#define BACKLOG		64
#define MAX_EVENTS	512
extern int socket_init(socket_t *sock, char *host, int port);
extern int socket_connect(socket_t *sock);
extern int socket_close(socket_t *sock);
extern int socket_resolver(const char *domain, char* ipaddr);
extern int socket_check_connect(socket_t *sock);
extern int socket_write(int sockfd, char *buf, int bytes);
extern void set_socket_rlimit(void);
extern int socket_server_init(socket_t *sock);
extern int socket_read(int sockfd, char *buf, int size);
#endif

/* ----- #ifndef _SOCKET_H_  ----- */
